package com.jmxcfc.blfsc.langyu.enums;

/**
 * 朗宇响应状态
 * @author pbs
 */
public enum ResponseStatusEnum {

    RESP_0("0","提交成功"),

    RESP_101("101","无此用户"),

    RESP_102("102","密码错误"),

    RESP_103("103","用户名或密码错误"),

    RESP_104("104","系统忙（因平台侧原因，暂时无法处理提交的短信）"),

    RESP_105("105","敏感短信（短信内容包含敏感词）"),

    RESP_108("108","手机号码个数错误（>50000或<=0）"),

    RESP_109("109","无发送额度（该用户可用短信条数为0）"),

    RESP_110("110","不在发送时间内"),

    RESP_111("111","参数不正确"),

    RESP_112("112","无此产品，或用户没有订购该产品"),

    RESP_113("113","extno格式错（非数字或者长度不对）"),

    RESP_114("114","可用参数组个数错误（=0或>1000）"),

    RESP_115("115","自动审核驳回"),

    RESP_116("116","签名不合法，未带签名（用户必须带签名的前提下）"),

    RESP_117("117","IP地址认证错,请求调用的IP地址不是系统登记的IP地址"),

    RESP_118("118","用户没有相应的发送权限"),

    RESP_119("119","用户已过期"),

    RESP_120("120","内容不在白名单模板中"),

    RESP_122("122","超日发送限额"),

    RESP_125("125","超流速"),

    RESP_126("126","ts 时间戳与短信平台时间相差超过5分钟，请检查服务器时间"),

    RESP_127("127","运营商网络峰值失败"),

    RESP_OTHER("OTHER","未知异常"),

    ;

    /**
     * 状态
     */
    private String status;

    /**
     * 描述
     */
    private String desc;


    ResponseStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String status() {
        return this.status;
    }

    public String desc() {
        return this.desc;
    }


    /**
     * 根据值  获取 枚举
     * @param status
     * @return
     */
    public static ResponseStatusEnum getEnumByValue(String status) {
        ResponseStatusEnum[] instances = ResponseStatusEnum.values();
        for(ResponseStatusEnum instance : instances){
            if(instance.status().equals(status)){
                return instance;
            }
        }
        return RESP_OTHER;
    }
}
